import { Component, OnInit, Inject, forwardRef, ViewChild } from '@angular/core';
import { AppComponent } from '../../../app.component';
import { path } from '../../../path.config';
import { masterService } from '../../../../lib/master.service';
import { ExchangeCardTemplateGridComponent } from './exchange-card-template-grid/exchange-card-template-grid.component';

@Component({
    selector: 'exchange-card-template-management',
    templateUrl: './exchange-card-template-management.component.html',
    styleUrls: ['./exchange-card-template-management.component.css']
})
export class ExchangeCardTemplateManagementComponent implements OnInit {
    @ViewChild('ExchangeCardTemplateGrid') ExchangeCardTemplateGrid: ExchangeCardTemplateGridComponent;

    public filter = {
        pageSize: '10',
        pageIndex: '1',
        name: '',
        goodsName: ''
    }

    constructor(private _masterService: masterService) { }

    ngOnInit() { }

    // 过滤grid数据
    selectListItem() {
        this.ExchangeCardTemplateGrid.onChangeTable(this.filter, '1');
    }

    openModal() {
        this._masterService.openCardTemplate.emit();
    }
}
